import { getTradeDataDaySummaryList, showMsg } from '../../../vuex/action'
import QueryModal from '../common/query-modal/query-modal.vue'

export default {
  data() {
    return {
      showQueryModal: false,
      params: {
        start: 0,
        limit: 9999,
        startTime: '',
        endTime: '',
        relaAccountType: '',
        channel: ''
      },
      list: []
    }
  },
  events: {
    toogle_query() {
      this.queryTradeDataDaySummaryList()
    }
  },
  methods: {
    queryTradeDataDaySummaryList() {
      this.xGetTradeDataDaySummaryList(this.params)
        .then((res) => {
          this.showQueryModal = false
          this.list = res.data.list
        }).catch((res) => {
        this.xShowMsg({
          type: 'danger',
          content: res.error_msg
        })
      })
    }
  },
  vuex: {
    actions: {
      xGetTradeDataDaySummaryList: getTradeDataDaySummaryList,
      xShowMsg: showMsg
    }
  },
  components: {
    'query-modal': QueryModal
  }
}
